#pragma once
#include<string>
#include<sstream>
#include"Event.h"

//#include"myMiniEngine/Core/MouseCodes.h"

namespace myMiniEngine {
	class MGE_API MouseMovedEvent :public Event {
	public:

		MouseMovedEvent(const float x, const float y) : mx(x), my(y) {}

		inline float GetX() { return mx; }
		inline float GetY() { return my; }

		std::string ToString() const override
		{
			std::stringstream ss;
			ss << "MouseMovedEvent: (" << mx << ", " << my<<")";
			return ss.str();
		}

		EVENT_CLASS_TYPE(MouseMoved)
			EVENT_CLASS_CATEGORY(EventCategoryMouse | EventCategoryInput)

	private:
		float mx, my;
	};

	class MGE_API MouseScrolledEvent :public Event {
	public:
		MouseScrolledEvent(const float x, const float y): offsetX(x),offsetY(y){}

		inline float GetOffsetX() const { return offsetX; }
		inline float GetOffsetY() const { return offsetY; }

		std::string ToString() const override
		{
			std::stringstream ss;
			ss << "MouseScrolledEvent: (" << offsetX << ", " << offsetY << ")";
			return ss.str();
		}
		EVENT_CLASS_TYPE(MouseScrolled)
			EVENT_CLASS_CATEGORY(EventCategoryMouse | EventCategoryInput)

	private:
		float offsetX, offsetY;
	};

	class MGE_API MouseButtonEvent :public Event {
	public:
		inline int GetButton() const { return button; };

		EVENT_CLASS_CATEGORY(EventCategoryMouse | EventCategoryInput)


	protected:
		MouseButtonEvent(int button) : button(button){}
		int button;
	};

	class MGE_API MouseButtonPressedEvent :public MouseButtonEvent {
	public:
		MouseButtonPressedEvent(int button):MouseButtonEvent(button){}

		std::string ToString() const override
		{
			std::stringstream ss;
			ss << "MouseButtonPressedEvent: "<<button<<std::endl;
			return ss.str();
		}

		EVENT_CLASS_TYPE(MouseButtonPressed)
	};

	class MGE_API MouseButtonReleasedEvent :public MouseButtonEvent {
	public:
		MouseButtonReleasedEvent(int button) :MouseButtonEvent(button) {}

		std::string ToString() const override
		{
			std::stringstream ss;
			ss << "MouseButtonReleasedEvent: " << button << std::endl;
			return ss.str();
		}

		EVENT_CLASS_TYPE(MouseButtonReleased)

	};
}